package com.kfc.order.service.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kfc.order.dao.CustomerDao;
import com.kfc.order.service.CustomerManager;
import com.kfc.order.vo.Address;
import com.kfc.order.vo.Customer;
import com.kfc.order.vo.OrderForm;

@Service("cm")
public class CustomerManagerImpl implements CustomerManager {
	@Autowired(required=true)
	private CustomerDao cd;

	@Override
	public Customer login(String userName, String passwd) {
		// TODO Auto-generated method stub
		return cd.findCustomer(userName, passwd);
	}

	@Override
	@Transactional
	public int regist(Customer customer) {
		// TODO Auto-generated method stub
		return cd.addCustomer(customer);
	}

	@Override
	public boolean isExist(String tel) {
		// TODO Auto-generated method stub
		return cd.findTel(tel);
	}

	@Override
	public Address addAddress(Address address) {
		// TODO Auto-generated method stub
		return cd.addAddress(address);
	}

	@Override
	public OrderForm addOrderForm(OrderForm orderForm) {
		// TODO Auto-generated method stub
		return cd.addOrderForm(orderForm);
	}

}
